using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fated.Character.ChartGeneration {
    internal class Aspect {
        Planet.PlanetNames planet1;
        Planet.PlanetNames planet2;
        AspectType aspect;

        public int[] stats;
        public float[] amounts;
        public enum AspectType {
            Conjunct, Trine,
            Sextile, Opposite, Square
        };
        public Aspect(int p1, int p2, AspectType a) {
            if (p1 < p2) {
                this.planet1 = (Planet.PlanetNames)p1;
                this.planet2 = (Planet.PlanetNames)p2;
            } else {
                this.planet1 = (Planet.PlanetNames)p2;
                this.planet2 = (Planet.PlanetNames)p1;
            }
            this.aspect = a;


            // Sun - Moon, Mercury, Venus, Mars, Jupiter, Saturn
            // Moon - Mercury, Venus, Mars
            // Mercury - Venus, Mars
            // Venus - Mars
            // Jupiter - Moon, Mercury, Venus, Mars
            // Saturn - Moon, Mercury, Venus, Mars
            // Uranus - Moon, Mercury, Venus, Mars
            // Neptune - Moon, Mercury, Venus, Mars
            // Pluto - Moon, Mercury, Venus, Mars
            //Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto
            //----------------------Special Planets
            if (this.planet2 == Planet.PlanetNames.Pluto)
                Pluto.addAspect(this.planet1, this.aspect);
            else if (this.planet1 == Planet.PlanetNames.Sun)
                Sun.addAspect(this.planet2, this.aspect);
            //----------------------Outer Planets
            else if (this.planet2 == Planet.PlanetNames.Neptune && this.planet1 < Planet.PlanetNames.Jupiter)
                Neptune.generateStats(out amounts, out stats, this.planet1, this.aspect);

            else if (this.planet2 == Planet.PlanetNames.Uranus && this.planet1 < Planet.PlanetNames.Jupiter)
                Uranus.generateStats(out amounts, out stats, this.planet1, this.aspect);

            else if (this.planet2 == Planet.PlanetNames.Jupiter && this.planet1 < Planet.PlanetNames.Saturn)
                Jupiter.generateStats(out amounts, out stats, this.planet1, this.aspect);

            else if (this.planet2 == Planet.PlanetNames.Saturn && this.planet1 < Planet.PlanetNames.Saturn)
                Saturn.generateStats(out amounts, out stats, this.planet1, this.aspect);
            //----------------------Inner Planets
            else if (this.planet1 == Planet.PlanetNames.Moon && this.planet2 < Planet.PlanetNames.Saturn)
                Moon.generateStats(out amounts, out stats, this.planet2, this.aspect);

            else if (this.planet1 == Planet.PlanetNames.Mercury && this.planet2 < Planet.PlanetNames.Saturn)
                Mercury.generateStats(out amounts, out stats, this.planet2, this.aspect);

            else if (this.planet1 == Planet.PlanetNames.Venus && this.planet2 < Planet.PlanetNames.Saturn)
                Venus.generateStats(out amounts, out stats, this.planet2, this.aspect);
        }

        public Planet.PlanetNames getPlanet1() {
            return planet1;
        }
        public AspectType getAspect() {
            return aspect;
        }
        public Planet.PlanetNames getPlanet2() {
            return planet2;
        }
        public float[] getAmounts() {
            return amounts;
        }
        public int[] getStats() {
            return stats;
        }
    }
}
